package team.seekers.catering.common.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import lombok.Getter;

import java.util.Arrays;

/**
 * 食材参考摄入量
 */
@Getter
public enum DRIsEnum  implements IEnum<Integer> {

    KAL(0,2000.0,  "总能量",  "kcal/d"),
    PRO(1,65.0,  "蛋白质",  "g/d"),
    FAT(2,60.0,  "脂肪",  "g/d"),
    CHO(3,280.0,  "碳水化合物",  "g/d"),
    FIBTG(4,25.0,  "总膳食纤维",  "g/d"),
    NA(5,1500.0,  "钠",  "mg/d"),
    K(6,2000.0,  "钾",  "mg/d"),
    CA(7,800.0,  "钙",  "mg/d"),
    MG(8,330.0,  "镁",  "mg/d"),
    P(9,720.0,  "鳞",  "mg/d"),
    FE(10,20.0,  "铁",  "mg/d"),
    ZN(11,12.5,  "锌",  "mg/d"),
    CU(12,0.8,  "铜",  "mg/d"),
    MN(13,4.5,  "锰",  "mg/d"),
    ID(14,120.0,  "碘",  "ug/d"),
    SE(15,60.0,  "硒",  "ug/d"),
    CR(16,30.0,  "铬",  "ug/d"),
    MO(17,100.0,  "钼",  "ug/d"),
    VITA_RAE(18,800.0,  "维生素A(视黄醇活性当量)",  "ug/d"),
    VITD(19,10.0,  "维生素D",  "ug/d"),
    TE_D(20,14.0,  "维生素E(α-生育酚当量)",  "ug/d"),
    VITK(21,80.0,  "维生素K",  "ug/d"),
    THIAHCL(22,1.4,  "维生素B1",  "mg/d"),
    RIBF(23,1.4,  "维生素B2",  "mg/d"),
    NIA(24,15.0,  "烟酸",  "mg/d"),
    VITB6A(25,1.4,  "维生素B6",  "mg/d"),
    VITB12(26,2.4,  "维生素B12",  "ug/d"),
    FOL(27,400.0,  "叶酸",  "ug/d"),
    PANTAC(28,5.0,  "泛酸",  "mg/d"),
    BIOT(29,40.0,  "生物素",  "ug/d"),
    VITC(30,100.0,  "维生素C",  "mg/d"),
    NACL_EQ(31,6.0,  "食盐当量",  "g/d"),

    ;
    private Integer value;

    private Double amount;

    private String name;

    private String unit;


    DRIsEnum(int value,Double amount, String name,String unit) {
        this.value = value;
        this.amount = amount;
        this.name = name;
        this.unit = unit;
    }


    public static DRIsEnum getByValue(int value) {
        return Arrays.stream(values()).filter(e -> e.getValue() == value).findFirst().orElse(null);
    }

}
